﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace PIM_ATE
{
    #region object

    public class ImpCtrl
    {
        public bool bQuit;
        public bool bCtrl;
    }

    class EventProcessArgs : EventArgs
    {
        public int processNum { get; set; }
        public bool processState { get; set; }
        public object processObj { get; set; }
    }

    class EventLoggingArgs : EventArgs
    {
        public bool isTips { get; set; }
        public object logObj { get; set; }
        public bool isClose { get; set; }
        public EventLoggingArgs(bool isTips, object obj, bool isClose = false)
        {
            this.isTips = isTips;
            this.logObj = obj;
            this.isClose = isClose;
        }
    }

    #endregion

    #region enum Object

    enum Running_Mode
    {
        PIM = 0,
        ENG = 1,
        ELEC = 2,
        PIM_CAL = 3
    }

    enum Instrument
    {
        DESKTOP = 0,
        MULTI_BAND = 1,

        DESKTOP_FOR_FWD = 10,
        DESKTOP_FOR_1REV = 11,
        DESKTOP_FOR_2REV = 12,
        DESKTOP_FOR_4REV = 13,
        DESKTOP_FOR_6REV = 14,
        DESKTOP_FOR_PORT = 15,
        DESKTOP_FOR_COMPAT = 16,

        MULTI_BAND_FOR_HEIWEI = 20,
        MULTI_BAND_FOR_HEIWEI_FWD = 21,
        MULTI_BAND_FOR_POI = 22,
        MULTI_BAND_FOR_NEWPOI = 23,
        MULTI_BAND_FOR_NEWHEIWEI = 24
    }

    enum InstrumentGroup
    {
        DESKTOP = 0,
        MULTI_BAND = 1,
        RFDESKTOP = 2
    }

    enum MSG_TYPE
    {
        LOG_TEST = 0,
        LOG_NET = 1,
        ERROR_SET = 2,
        ERROR_NET = 3,
        ERROR_TEST = 4,
        ERROR_INIT = 5
    }

    enum ImSchema
    {
        REV = 0,
        FWD = 1
    }

    enum ImUnit
    {
        dBm = 0,
        dBc = 1
    }

    enum ImMode
    {
        Time = 0,
        Freq = 1
    }

    enum ImOrder : int
    {
        Im3 = 3,
        Im5 = 5,
        Im7 = 7,
        Im9 = 9
    }

    enum SignalNo
    {
        F1 = 0,
        F2 = 1
    }

    enum SwitchType : int
    {
        SWITCH_NONE = 0,
        SWITCH_SW = 1,
        SWITCH_JC = 2,
        SWITCH_JieXi = 3,
        SWITCH_Hxinwb=4
    }

    enum RCUState
    {
        SUCCESS = 1,
        FAIL = 2,
        TIMEOUT = 3
    }

    enum AntennaType
    {
        NUMAL = 0,
        TD = 1,
        MIX = 2
    }
   public  enum AntennaTestMethod
    {
        Together = 0,
        Separate = 1
    }
  public  enum AntennaTestType
    {
        Numal = 0,
        InterbandIsolation = 1,
        AmplitudePhase = 2
    }

    public enum ModTestMode
    {
        First = 0,
        Second = 1
    }

    #endregion

    public struct GDefine
    {
        //public static int SWITCH_SW = 0;
        //public static int SWITCH_JC = 1;
        //public static int SWITCH_JieXi = 3;
        //public static int SWITCH_NONE = 2;

        public static int LEN_FDATA = 0xb0000;//FDATA max buf

        public static string VNA_5062A = "VNA-5062A";
        public static string VNA_5071B = "VNA-5071B";
        public static string VNA_5071C = "VNA-5071C";
        public static string VNA_5061B = "VNA-5061B";

        public static string PATH_VNA_INI = "\\JcVNADevices.ini";

        public static string INI_SECTION_LAST = "LastCfg";
        public static string INI_SECTION_INSTR = "Instr";
        public static string INI_INSTR_NAME = "InstrName";
        public static string INI_INSTR_ADDR = "InstrAddr";
        public static string INI_SWITCH_TYPE = "SwitchType";
        public static string INI_SWITCH_PORT = "SwitchPort";
        public static string INI_SWITCH_COUNT = "SwitchCount";
        public static string INI_RCU_TYPE = "RCUType";
        public static string INI_RCU_PORT = "RCUPort";
        public static string FILTER_STRING_XLS = "*.xls|*.xls";

        public static string FILTER_STRING_SPARAM = "*.elec|*.elec";
        public static string SUFFIX_STRING_SPARAM = ".elec";
        public static string FILTER_STRING_PIM = "*.pim|*.pim";
        public static string SUFFIX_STRING_PIM = ".pim";

        public const string ContentPass = "PASS";
        public const string ContentFail = "FAIL";
        public const string ContentPass2 = "Pass";
        public const string ContentFail2 = "Fail";

        public const string RCU_PORT_NAME = "+45度";
        public const string RCU_PORT_NAME_2 = "-45度";

        public const string ColorHexPass = "#76EEC6";
        public const string ColorHexFail = "#FF7256";

        public const string DBNamePIM = "ANTENNA";
        public const string DBNameELEC = "ANTENNA";
        public const string DBNameMOD = "MOD";

        #region DEBUG Control

        public const bool IS_LOCAL = false;

        public const bool IS_USER_NOT_LOGIN = false;        //无需用户登陆
        public const bool IS_USER_ALL_ADMIN = false;       //用户获得所有权限
        public const bool IS_VERSION_NOCHECK = false;       //是否关闭软件版本校验步骤

        public const int RUNNING_MODE = 0;                  //0为天线部门,1为射频部门

        //天线部门控制
        public const bool IS_LOCAL_CONFIG_ANTENNA = false;   //天线数据库测试配置,false为开启.
        public const bool IS_LOCAL_CONFIG_SPARAM = false;    //电性能数据库测试配置. 
        public const bool IS_LOCAL_RESULT_ANTENNA = false;   //天线或者电性能测试结果是否上传到数据库,false为上传
        public const bool IS_RCU_DEBUG_TEST = false;        //RCU的模拟debug功能
        public const bool IS_VNA_DEBUG_TEST = false;        //网分仪的模拟debug功能
        public const bool IS_SWITCH_DEBUG_TEST = false;     //电性能开关矩阵模拟debug功能
        public const bool IS_PIM_ZUO = false;               //
        public const bool IS_MY_DB = false;   //10.53.28.170 
        public const bool IS_UploadElecNew = false;//false为使用    测试条码-->  MBTDA0100334H300635
        public const bool IS_UploadFAD = false;    //FAD天线及西安微基站插损耦合的测试数据是否上传 ,false为上传
        public const bool IS_UpLoadCalRecord = false;//是否上传校准记录

        public const bool IS_Cal_NOCHECEK = true;//是否关闭校验校准记录步骤  

        //射频部门控制
        public const bool IS_LOCAL_CONFIG_MOD = false;      //是否连接数据库
        public const bool IS_NOCHECK_CAL_MOD = false;       //不校验校准数据
        public const bool IS_LOCAL_RESULT_MOD = false;      //是否上传结果
        public const bool IS_COMPAT_DEBUG_TEST = false;     //compat的模拟debug功能
        public const bool IS_LOCAL_RESULT_ZTE = false;     //是否传中兴数据库
        public const bool IS_Repair_AutoBuild = false;      //返修功能是否开启
        public const bool IS_DOWN_CAL_MOD = false;        //是否下载校准

        public const bool IS_PIM_SECOND = true;     //二次交调是否开启
        public const bool IS_CONBINED_BAND = true;   //多频段数据合并功能是否开启
        #endregion



    }
}
